
<div class="intro-cartasur">
  <h3><%= t 'cartasur.forums.introtitle' %></h3>
  <p><%= t 'cartasur.forums.introdescription' %></p>
</div>

<br />

<table id="forums">
  <tr>
    <th width="70%"><%= t 'cartasur.forums.forumtitle' %></th>
    <th width="30%"><%= t 'cartasur.forums.lastpost'%></th>
    <th></th><th></th>
  </tr>
  <% for forum in @forums %>
      <tr>
        <td><h4><%= link_to h(forum.name), cartasur_forum_path(forum.id) %></h4>
          <small><%= forum.topics.count %> topics</small><br />
          <%=h forum.description %>
        </td>
        <td>
          <% if forum.most_recent_post %>
              <%= distance_of_time_in_words_to_now forum.most_recent_post.last_post_at %> <%= t 'cartasur.forums.ago' %><% else %><%= t 'cartasur.forums.notopics' %><% end %>
        </td>
        <% if admin? %>
            <td class="right"><%= link_to (t 'cartasur.forums.edit'), edit_cartasur_forum_path(forum) %></td>
            <td class="right"><%= link_to (t 'cartasur.forums.destroy'), forum, :confirm => 'Are you sure?', :method => :delete %></td>
        <% end %>
      </tr>
  <% end %>
</table>

<% if admin? %>
<p><%= link_to "New Forum", new_cartasur_forum_path %></p>
<% end %>